Skip to content

feat: add conversation export in JSON, Markdown, and text formats#2147

Open
KhawarHabibKhan wants to merge 7 commits intoAzure-Samples:mainfrom
KhawarHabibKhan:feat/conversation-export
Open

feat: add conversation export in JSON, Markdown, and text formats#2147
KhawarHabibKhan wants to merge 7 commits intoAzure-Samples:mainfrom
KhawarHabibKhan:feat/conversation-export

Conversation

@KhawarHabibKhan
Copy link
Copy Markdown

Summary

  • Added a new POST /api/history/export endpoint that exports conversations in JSON, Markdown, or plain text format
  • Added export button with format picker on each conversation in the chat history sidebar
  • Added export button in the active chat view next to the clear chat button

Changes

Backend (code/backend/api/chat_history.py)

  • Three formatter functions for JSON, Markdown, and plain text output
  • New /api/history/export endpoint with authentication, format validation, and file download response

Frontend

  • api.ts: New historyExport() function that calls the backend and triggers browser file download
  • ChatHistoryListItemCell.tsx: Export button with context menu (JSON/Markdown/Text) on each conversation
  • Chat.tsx: Export button next to clear chat button for exporting active conversation

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a conversation export feature across backend and frontend, enabling users to download a conversation from chat history in JSON, Markdown, or plain text.

Changes:

  • Backend: added formatter functions and a new POST /api/history/export endpoint that returns a downloadable file.
  • Frontend: added historyExport() API helper that triggers a browser download.
  • UI: added export buttons + format pickers in both the chat history sidebar items and the active chat view.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
code/backend/api/chat_history.py Adds export endpoint and formatters for JSON/Markdown/text responses.
code/frontend/src/api/api.ts Adds historyExport() to call export API and download the resulting file.
code/frontend/src/components/ChatHistoryListItemCell/ChatHistoryListItemCell.tsx Adds per-conversation export button with contextual format menu.
code/frontend/src/pages/chat/Chat.tsx Adds export button/menu in active chat view near the clear chat control.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

KhawarHabibKhan and others added 6 commits April 6, 2026 18:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ryListItemCell.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@KhawarHabibKhan
Copy link
Copy Markdown
Author

I have reviewed and made changes according to the Copilot Suggestions. Please review again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants